package com.stlm2.dems.entity.base;

import com.stlm2.dems.entity.FlowSource;
import com.stlm2.dems.entity.FlowType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by ZLQ on 2017/6/10.
 */
public class BaseFmsFlow implements Serializable {
    //主键ID
    private  int id;
    //类型 
    private FlowType type;
    //来源
    private FlowSource source;
    //改变的值
    private BigDecimal change_num;
    //生成时间
    private Date createTime;
    //用户ID
    private int userId;
    //关联的编码
    private  String referCode;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public FlowType getType() {
        return type;
    }

    public void setType(FlowType type) {
        this.type = type;
    }

    public FlowSource getSource() {
        return source;
    }

    public void setSource(FlowSource source) {
        this.source = source;
    }

    public BigDecimal getChange_num() {
        return change_num;
    }

    public void setChange_num(BigDecimal change_num) {
        this.change_num = change_num;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getReferCode() {
        return referCode;
    }

    public void setReferCode(String referCode) {
        this.referCode = referCode;
    }

    /**
     * 映射：资金流水类型
     */
    public Integer getTypeValue() {
        return (type != null) ? type.getIntValue() : null;
    }

    public void setTypeValue(Integer value) {
        if (value != null)
            this.type = FlowType.getByIntValue(value);
    }
    /**
     * 映射：资金来源
     */
    public Integer getSourceValue() {
        return (source != null) ? source.getIntValue() : null;
    }

    public void setSourceValue(Integer value) {
        if (value != null)
            this.source = FlowSource.getByIntValue(value);
    }
}
